#include <iostream>
#include <pthread.h>
#include <memory>
#include "mythread.hpp"
#include <unistd.h>
using namespace std;
void *thread_run(void *args)
{
    const char *str = static_cast<char *>(args);
    cout << args << "已创建" << endl;
    return nullptr;
}
int main()
{
    unique_ptr<Thread> thread1(new Thread(thread_run, (void *)"thread 1"));
    sleep(1);
    unique_ptr<Thread> thread2(new Thread(thread_run, (void *)"thread 2"));
    sleep(1);
    unique_ptr<Thread> thread3(new Thread(thread_run, (void *)"thread 3"));
    sleep(1);

    thread1->join();
    thread2->join();
    thread3->join();
}